<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>uartpsv: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">uartpsv
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">uartpsv Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This section contains the implementation of the interface functions for <a class="el" href="struct_x_uart_psv.html" title="The XUartPsv driver instance data structure. ">XUartPsv</a> driver. The UartPsv driver supports the following features:</p>
<ul>
<li>Dynamic data format (baud rate, data bits, stop bits, parity)</li>
<li>Polled mode</li>
<li>Interrupt driven mode</li>
<li>Transmit and receive FIFOs (32 byte FIFO depth)</li>
<li>Access to the external modem control lines</li>
</ul>
<p><b>Initialization &amp; Configuration</b></p>
<p>The <a class="el" href="struct_x_uart_psv___config.html" title="This typedef contains configuration information for the device. ">XUartPsv_Config</a> structure is used by the driver to configure itself. Fields inside this structure are properties of <a class="el" href="struct_x_uart_psv.html" title="The XUartPsv driver instance data structure. ">XUartPsv</a> based on its hardware build.</p>
<p>To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:</p>
<ul>
<li>XUartPsv_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a configuration structure provided by the caller. If running in a system with address translation, the parameter EffectiveAddr should be the virtual address.</li>
</ul>
<p><b>Baud Rate</b></p>
<p>The UART has an internal baud rate generator, which furnishes the baud rate clock for both the receiver and the transmitter. Their input clock frequency can be either the master clock or the master clock divided by 8, configured through the mode register.</p>
<p>Accompanied with the baud rate divider register, the baud rate is determined by: </p>
<pre>
      baud_rate = input_clock / (bgen * (bdiv + 1)
</pre><p> where bgen is the value of the baud rate generator, and bdiv is the value of baud rate divider.</p>
<p><b>Interrupts</b></p>
<p>The FIFOs are not flushed when the driver is initialized, but a function is provided to allow the user to reset the FIFOs if desired.</p>
<p>The driver defaults to no interrupts at initialization such that interrupts must be enabled if desired. An interrupt is generated for one of the following conditions.</p>
<ul>
<li>A change in the modem signals</li>
<li>Data in the receive FIFO for a configuable time without receiver activity</li>
<li>A parity error</li>
<li>A framing error</li>
<li>An overrun error</li>
<li>Transmit FIFO is full</li>
<li>Transmit FIFO is empty</li>
<li>Receive FIFO is full</li>
<li>Receive FIFO is empty</li>
<li>Data in the receive FIFO equal to the receive threshold</li>
</ul>
<p>The application can control which interrupts are enabled using the <a class="el" href="group__uartpsv.html#ga09b94a490c696d7ff7b1c6bbec42b226" title="This function sets the interrupt mask. ">XUartPsv_SetInterruptMask()</a> function.</p>
<p>In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, <a class="el" href="group__uartpsv.html#ga869ac0531d2e16457706d013d7f0a0cc" title="This function is the interrupt handler for the driver. ">XUartPsv_InterruptHandler()</a>, to the interrupt system of the application. A separate handler should be provided by the application to communicate with the interrupt system, and conduct application specific interrupt handling. An application registers its own handler through the <a class="el" href="group__uartpsv.html#gafc24dc61fc253a957ba631fb53b5dfc8" title="This function sets the handler that will be called when an event (interrupt) occurs that needs applic...">XUartPsv_SetHandler()</a> function.</p>
<p><b>Data Transfer</b></p>
<p>The functions, <a class="el" href="group__uartpsv.html#ga71a962de4963e15f1c38e7831e825f7c" title="This functions sends the specified buffer using the device in either polled or interrupt driven mode...">XUartPsv_Send()</a> and <a class="el" href="group__uartpsv.html#ga4d4d20bbcedb1de2adbe2644b821d12d" title="This function attempts to receive a specified number of bytes of data from the device and store it in...">XUartPsv_Recv()</a>, are provided in the driver to allow data to be sent and received. They can be used in either polled or interrupt mode.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The default configuration for the UART after initialization is:</p>
<ul>
<li>9,600 bps or XPAR_DFT_BAUDRATE if defined</li>
<li>8 data bits</li>
<li>1 stop bit</li>
<li>no parity</li>
<li>FIFO's are enabled with a receive threshold of 8 bytes</li>
<li>The RX timeout is enabled with a timeout of 1 (4 char times)</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver  Who  Date      Changes
</p>
<hr/>
<p>
1.0  sg   09/18/17  First Release
1.2  rna  01/20/20  Modify the interrupt path according to the TRM
              Add XUartPsv_ProgramCtrlReg function
              Add XUartPsv_SetTxFifoThreshold function
              Add XUartPsv_SetRxFifoThreshold function
1.3  rna  04/05/20  Change input format for XUartPsv_SetDataFormat function
              to reflect the Linecontrol register
1.4  sne  02/03/21  Updated uartpsv_tapp.tcl to support CIPS3.0 hier designs.
     rna  03/15/21  Updated 'XUartPsv_SetBaudRate' function
1.5  rna  03/31/21  Fixed doxygen warnings
1.6  adk  03/15/22  Updated uartpsv_tapp.tcl interrupt id variable for
                      CIPS3 designs when stdout is configured as none.
1.9  adk  04/14/23  Added support for system device-tree flow.
</pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
